//
//  XMGVerticalButton.m
//  百思不得姐
//
//  Created by 杨庆 on 2017/1/6.
//  Copyright © 2017年 杨庆. All rights reserved.
//

#import "XMGVerticalButton.h"

@implementation XMGVerticalButton
-(void)awakeFromNib{

	[self setup];
}

-(instancetype)initWithFrame:(CGRect)frame{
	if (self=[super initWithFrame:frame]) {
		[self setup];
	}
	return self;
}

-(void)setup{
	self.titleLabel.textAlignment=NSTextAlignmentCenter;
}

-(void)layoutSubviews{
	[super layoutSubviews];
	
	//调整图片
	self.imageView.x=0;
	self.imageView.y=0;
	self.imageView.width=self.width;
	self.imageView.height=self.imageView.width;
	
	
	//调整文字
	self.titleLabel.x=0;
	self.titleLabel.y=self.imageView.height+8;
	self.titleLabel.width=self.width;
	self.titleLabel.height=self.height-self.imageView.height;
	
}

@end
